import { initMixin } from './init'
import { stateMixin } from './state'
import { renderMixin } from './render'
import { eventsMixin } from './events'
import { lifecycleMixin } from './lifecycle'
import { warn } from '../util/index'
// 不用class的原因是因为方便后续给Vue实例混入实例成员和原型
function Vue (options) {
  if (process.env.NODE_ENV !== 'production' &&
    !(this instanceof Vue)
  ) {
    warn('Vue is a constructor and should be called with the `new` keyword')
  }
  this._init(options)
}
// 下面几个方法都是给Vue的原型上挂载方法

//挂载_init方法
initMixin(Vue)
//挂载 $data $props $set $delete $watch
stateMixin(Vue)
// $on $once  $off $emit
eventsMixin(Vue)
// 生命周期相关
// _update $forceUpdate $destroy
lifecycleMixin(Vue)
//render相关  $nextTick _render 以及一些下划线_开头的方法
renderMixin(Vue)

export default Vue
